/*
 * MS5611.hpp
 *
 *  Created on: Jun 8, 2016
 *      Author: Yang
 */

#ifndef MS5611_HPP_
#define MS5611_HPP_

#include "HAL/HAL.hpp"
#include "Console/Console.hpp"

class Altitude_MS5611
{
public:
    int32_t pressure;
    Altitude_MS5611()
    {
    }
    void Init(void);
    void Data_Refresh(void);
private:
    uint16_t SENS_T1 = 0, OFF_T1 = 0, TCS = 0, TCO = 0, T_REF = 20, TEMPSENS = 0;
    uint32_t Digital_pressure_value = 0, Digital_temperature_value = 0;
    uint16_t P_Min= 10,P_Max = 1200;
    int16_t T_Min = -40,T_Max = 85;
    void WRITE(uint8_t Cmd);
    void READ(uint8_t* Data, uint8_t Cmd, uint8_t Len);
};

#endif /* MS5611_HPP_ */
